
package gui.panels;

import gui.MainFrame;
import gui.listeners.GuiActionEvent;
import gui.listeners.GuiActionEventType;
import gui.model.DrinkModel;
import gui.panels.components.MmiButton;
import java.awt.Color;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;

/**
 *
 * @author JtR
 */
public class SelectTeaPanel extends GuiPanel {
    private MmiButton greenTeaButton, blackTeaButton, fruitTeaButton;
    
    public SelectTeaPanel(MainFrame parent) {
        super(parent, BackgroundType.TEA);
    }
    
    @Override
    protected void initComponents() {
        greenTeaButton = new MmiButton("res/teetime/gruenerTee.png", 300);
        greenTeaButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                fireGuiActionEvent(new GuiActionEvent(GuiActionEventType.CHOSE_GREEN_TEA));
            }
        });
        constraints.insets = new Insets(50, 380, 0, 0);
        add(greenTeaButton, constraints);
        
        blackTeaButton = new MmiButton("res/teetime/schwarzTee.png", 300);
        blackTeaButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                fireGuiActionEvent(new GuiActionEvent(GuiActionEventType.CHOSE_BLACK_TEA));
            }
        });
        constraints.insets = new Insets(250, 600, 0, 0);
        add(blackTeaButton, constraints);
        
        fruitTeaButton = new MmiButton("res/teetime/fruechteTee.png", 300);
        fruitTeaButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                fireGuiActionEvent(new GuiActionEvent(GuiActionEventType.CHOSE_FRUIT_TEA));
            }
        });
        constraints.insets = new Insets(150, 100, 0, 0);
        add(fruitTeaButton, constraints);
    }

    @Override
    public String getDescription() {
        return "Bitte wählen Sie Ihre Teesorte";
    }

    @Override
    public void updateFields() {
    }

    @Override
    public boolean getPreviousButtonEnabled() {
        return true;
    }

    @Override
    public boolean getNextButtonEnabled() {
        return DrinkModel.getInstance().getTea()!= null;
    }

    @Override
    public String getName() {
        return "TEA_NAME";
    }

    @Override
    public GuiPanel getNextPanel() {
        return parent.selectSizePanel;
    }

    @Override
    public GuiPanel getPreviousPanel() {
        return parent.selectDrinkPanel;
    }
}
